import os, time


# 实现文件的拷贝
def copyFile(rPath, wPaht):
    fr = open(rPath, "rb")
    fw = open(wPaht, "wb")

    context = fr.read()
    fw.write(context)
    fr.close()
    fw.close()


path = r"F:\file"
topath = r"F:\tofile"

# 读取path下的所有的文件
filesList = os.listdir(path)

# 启动for循环处理每一个文件
start = time.time()
for fileName in filesList:
    copyFile(os.path.join(path,fileName), os.path.join(topath,fileName))

end = time.time()
print("总耗时：%0.2f" % (end-start))